/********************************************************************************
 *      Copyright:  (C) Guo Zixuan
 *                  All rights reserved.
 *
 *       Filename:  client_socket.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(09/04/25)
 *         Author:  Guo Zixuan <guozixuan@gmail.com>
 *      ChangeLog:  1, Release initial version on "09/04/25 20:16:19"
 *                 
 ********************************************************************************/
#ifndef _CLIENT_SOCKET_H_
#define _CLIENT_SOCKET_H_

#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <sys/types.h> 
#include <libgen.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <netinet/ip.h>
#include <sys/types.h>   
#include <netdb.h>
#include <string.h>
#include <netinet/tcp.h>
#include "logger.h"

#define HOSTNAME_LEN          64

typedef struct
{
	char        host[HOSTNAME_LEN];
	int         port;
	int         fd;
	int         status;
} socket_ctx_t;

int socket_init(socket_ctx_t *sock, char *host, int port);
int socket_connect(socket_ctx_t *sock);
int socket_status(socket_ctx_t *sock);
void socket_close(socket_ctx_t *sock);


#endif
